<?php
/**
 * Description of Docente
 *
 * @author Krix
 */
include '\DAL/GenericDAO.php';

class Administrador {
    var $IdAdmin;
    var $Nombre;
    var $Apellido;
    var $Telefono;
    var $Contrasena;
            
    public function ExisteDocente(){
        $conexion = ObtenerConexion();
        $statement = mysql_query("SELECT cod_administrador FROM tbladministrador WHERE cod_administrador=$this->IdDocente",$conexion);
        $result = false;
        if(mysql_num_rows($statement) > 0){
            $result = true;
        }
        mysql_free_result($statement);
        mysql_close($conexion);
        return $result;
    }

    public function BuscarLogin(){
        $conexion = ObtenerConexion();
        $statement = mysql_query("SELECT cod_administrador FROM tbladministrador WHERE cod_administrador=$this->IdAdmin AND contrasena = '$this->Contrasena'",$conexion);
        $result = false;
        if(mysql_num_rows($statement) > 0){
            $result = true;
        }
        mysql_free_result($statement);
        mysql_close($conexion);
        return $result;
    }
}
?>
